import * as types from './mutation-types'
import api from '@/http/api'
// 进行涉及到多个全局变量的复杂计算

// export const setOpenId = ({ commit }, { id }) => {
//     commit(types.OPEN_ID, id)
// }
export default {
  setOpenId: ({commit}, {id}) => commit(types.SET_OPEN_ID, id),
  setToken: ({commit}, {token}) => commit(types.SET_TOKEN, token),

  async getlucklist ({commit}) {
    const res = await api.getlucklist()
    if (res.success) {
      commit(types.SET_LUCK, res.data)
    }
  },
  async getluckdetail ({commit}, params) {
    const res = await api.getluckdetail(params)
    if (res.success) {
      commit(types.SET_LUCKDETAIL, res.data)
    }
  }

}
